﻿using King.Box.OpenApi.Service;
using King.Box.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace King.Box.OpenApi.Controllers
{
    public class ByPassController : ApiController
    {
        [HttpPost]
        public IHttpActionResult Notify([FromBody]NotifyRequest param)
        {
            SingletonBase<NotifyService>.Instance.MailNotify("抢票通知", param.body, param.mailTo);

            return Ok();
        }

        [HttpGet]
        public IHttpActionResult Notify([FromUri]string bypass)
        {
            SingletonBase<NotifyService>.Instance.MailNotify("抢票通知", bypass);

            return Ok();
        }
    }

    public class NotifyRequest
    {
        public string mailTo { get; set; }
        public string body { get; set; }
    }
}
